package com.atXiao.video.pubsub;

import com.atXiao.video.entity.req.common.MessageDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 自定义的消息接收器（生效需要在redisConfig中进行注册channel）
 */
@Slf4j
@Component
public class PrintMessageReceiver {
    @Autowired
    private RedisTemplate redisTemplate;

    public void receiveMessage(MessageDto messageDto , String channel) {

        // 接收的topic
        log.info("接收的topic:" + channel);

        log.info("接收的message:" + messageDto.getTitle());
    }
}
